package com.gg.bananvideo.model;

import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;

import java.io.Serializable;
import java.util.List;

public class PlayMsg implements Serializable, Parcelable {
    private Data data;

    private String errmsg;

    private Integer retcode;

    protected PlayMsg(Parcel in) {
        errmsg = in.readString();
        if (in.readByte() == 0) {
            retcode = null;
        } else {
            retcode = in.readInt();
        }
    }

    public static final Creator<PlayMsg> CREATOR = new Creator<PlayMsg>() {
        @Override
        public PlayMsg createFromParcel(Parcel in) {
            return new PlayMsg(in);
        }

        @Override
        public PlayMsg[] newArray(int size) {
            return new PlayMsg[size];
        }
    };

    public Data getData() {
        return this.data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public String getErrmsg() {
        return this.errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public Integer getRetcode() {
        return this.retcode;
    }

    public void setRetcode(Integer retcode) {
        this.retcode = retcode;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        //dest.write
        dest.writeString(errmsg);
        if (retcode == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(retcode);
        }
    }

    public static class Data implements Serializable {
        private Integer iszan;

        private Integer encurl;

        private String httpurl;

        private String xxx_api_auth;

        private Integer isfavorite;

        private List<Httpurls> httpurls;

        public Integer getIszan() {
            return this.iszan;
        }

        public void setIszan(Integer iszan) {
            this.iszan = iszan;
        }

        public Integer getEncurl() {
            return this.encurl;
        }

        public void setEncurl(Integer encurl) {
            this.encurl = encurl;
        }

        public String getHttpurl() {
            return this.httpurl;
        }

        public void setHttpurl(String httpurl) {
            this.httpurl = httpurl;
        }

        public String getXxx_api_auth() {
            return this.xxx_api_auth;
        }

        public void setXxx_api_auth(String xxx_api_auth) {
            this.xxx_api_auth = xxx_api_auth;
        }

        public Integer getIsfavorite() {
            return this.isfavorite;
        }

        public void setIsfavorite(Integer isfavorite) {
            this.isfavorite = isfavorite;
        }

        public List<Httpurls> getHttpurls() {
            return this.httpurls;
        }

        public void setHttpurls(List<Httpurls> httpurls) {
            this.httpurls = httpurls;
        }

        public static class Httpurls implements Serializable {
            private String httpurl;

            private String hdtype;

            public String getHttpurl() {
                return this.httpurl;
            }

            public void setHttpurl(String httpurl) {
                this.httpurl = httpurl;
            }

            public String getHdtype() {
                return this.hdtype;
            }

            public void setHdtype(String hdtype) {
                this.hdtype = hdtype;
            }
        }
    }
}
